  public function executeCartBatchAction(sfWebRequest $request)
  {
    $condition = $request->getParameter('batch_c');
    $items     = $this->configuration->getCartItemsAsObjects($condition);
    $action    = $request->getParameter('batch_action');

    if (count($items) == 0)
    {
      $this->getUser()->setFlash('error', 'No eligible items in cart.');
      $this->redirect('@<?php echo $this->getUrlForAction('list') ?>');
    }
    else
    {
      $ok_msgs        = array();
      $error_msgs     = array();
      foreach ($items as $object)
      {
        $message = null;
        if ($this->$action($object, $message))
        {
          $ok_msgs[] = $message;
        }
        else
        {
          $error_msgs[] = $message;
        }
      }

      sfContext::getInstance()->getConfiguration()->loadHelpers('I18N');
      if (count($ok_msgs) > 0)
      {
        $message = count($ok_msgs) == 1? 'An item has been processed.' : '%%quantity%% items has been processed.';
        $this->getUser()->setFlash('notice', __($message, array('%%quantity%%' => count($ok_msgs)), 'sf_admin'));
        $this->getUser()->setFlash('batch_executed', $ok_msgs);
      }
      if (count($error_msgs) > 0)
      {
        $message = count($error_msgs) == 1? 'An item could not be processed.' : '%%quantity%% items could not be processed.';
        $this->getUser()->setFlash('error', __($message, array('%%quantity%%' => count($error_msgs)), 'sf_admin'));
        $this->getUser()->setFlash('batch_not_executed', $error_msgs);
      }
    }
    
    $this->redirect('<?php echo $this->getModuleName()?>/cartIndex');
  }
